<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>和吉祥宝宝见面倒计时</title>
  <style>
    body {
      font-family: "Arial", sans-serif;
      text-align: center;
      margin-top: 8%;
      color: #d63384;
      overflow: hidden;

      /* 两张背景图同时存在：左半边+右半边 */
      background-image: url("https://i.postimg.cc/LsmcjQbn/hanini.jpg"),
                        url("https://i.postimg.cc/PJv9dgPF/1.jpg");
      background-position: left center, right center;
      background-repeat: no-repeat, no-repeat;
      background-size: 50% auto, 50% auto;
    }

    h1 {
      font-size: 32px;
      margin-bottom: 20px;
      text-shadow: 1px 1px 2px #fff;
    }

    #timer {
      font-size: 28px;
      font-weight: bold;
      text-shadow: 1px 1px 2px #fff;
    }

    .fall {
      position: fixed;
      top: -120px;
      width: 80px;
      animation: fall linear forwards;
      pointer-events: none;
    }

    @keyframes fall {
      to {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0.9;
      }
    }
  </style>
</head>
<body>
  <h1>和吉祥宝宝见面倒计时</h1>
  <div id="timer"></div>

  <script>
    // ===== 倒计时目标时间 =====
    const targetDate = new Date("2025-09-20T17:30:00").getTime();

    const timer = setInterval(() => {
      const now = new Date().getTime();
      const distance = targetDate - now;

      if (distance <= 0) {
        document.getElementById("timer").innerHTML =
          "🎉 终于和吉祥宝宝见面啦！抱抱抱~ 💕";
        clearInterval(timer);
      } else {
        const days = Math.floor(distance / (1000 * 60 * 60 * 24));
        const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
        const seconds = Math.floor((distance % (1000 * 60)) / 1000);

        document.getElementById("timer").innerHTML =
          `还有 ${days} 天 ${hours} 时 ${minutes} 分 ${seconds} 秒`;
      }
    }, 1000);

    // ===== 飘落图片逻辑 =====
    const images = [
      "https://i.postimg.cc/LsmcjQbn/hanini.jpg",
      "https://i.postimg.cc/PJv9dgPF/1.jpg"
    ];

    function createFallingImage() {
      const img = document.createElement("img");
      img.src = images[Math.floor(Math.random() * images.length)];
      img.classList.add("fall");
      img.style.left = Math.random() * 100 + "vw";
      img.style.width = (60 + Math.random() * 40) + "px";
      img.style.animationDuration = (4 + Math.random() * 5) + "s";
      document.body.appendChild(img);

      setTimeout(() => img.remove(), 10000);
    }

    setInterval(createFallingImage, 1200); // 每1.2秒出现一张
  </script>
</body>
</html>